<?php

class Category {
    private $_id;
    private $_ezpageid;
    private $_name;
    private $_title;
    private $_image;
    private $_url;
    private $_type;
    private $_description;
    
    private static $_types = array(
        fb_categories::PRODUCT_TYPE,
        fb_categories::CATEGORY_TYPE,
    );
    
   public function __construct($id) {
       $this->_id = $id;
   }
   
   public function id() {
       return $this->_id;
   }
    
   public function ezpageid() {
       return $this->_ezpageid;
   }
    
   public function set_ezpageid($ezpageid) {
       $this->_ezpageid = $ezpageid;
       return $this;
   }
    
   public function description() {
       return $this->_description;
   }
    
   public function name() {
       return $this->_name;
   }
   
   public function title() {
       return $this->_title;
   }
   
   public function type() {
       return $this->_type;
   }
   
   public function image() {
       return $this->_image;
   }
   
   public function url() {
       return $this->_url;
   }
   
   public function set_title($title) {
       $this->_title = $title;
       return $this;
   }
   
   public function set_name($name) {
       $this->_name = $name;
       return $this;
   }
   
   public function set_image($image) {
       $this->_image = $image;
       return $this;
   }
   
   public function set_url($url) {
       $this->_url = $url;
       return $this;
   }
   
   public function set_description($desc) {
       $this->_description = $desc;
       return $this;
   }
   
   public function set_type($type) {
       if(!in_array($type, self::$_types)) {
           throw new Exception('Tipo no valido');
       }
       $this->_type = $type;
       return $this;
   }
}
